package com.bjsxt.controller;

import com.bjsxt.pojo.Company;
import com.bjsxt.pojo.PageA;
import com.bjsxt.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/company")
public class CompanyContrller {
    @Autowired
    private CompanyService companyServicel;
    /*按条件查询公司信息*/
    @RequestMapping("/findMoreCompany")
    public PageA<Company> findMoreCompany(Integer page, Integer rows, Company company){
       return companyServicel.selectFindMore(page, rows, company);
    }
    //添加公司的信息  前台传递到后台的cid存储在了Company对象中
    @RequestMapping("/saveCompany")
    public Integer saveCompany(Company company){
      return companyServicel.saveCompany(company);
    }
    //修改公司的信息
    @RequestMapping("/changeCompany")
    public Integer changeCompany(Company company){
     return companyServicel.update(company);
    }
}
